/**
 * Created by user on 2017/3/1.
 */
import React from 'react';
import ReactDOM from 'react-dom';
import { Breadcrumb, Button } from 'antd';

const Index = React.createClass({
  contextTypes: {
    router: React.PropTypes.object
  },

  getInitialState() {
    return {
      item: '出租管理',
    }
  },

  handleRouter() {
    let path = this.props.location.pathname;
    let lastPath = path.split('/')[path.split('/').length - 1];
    let index = '/landlord/rentManage/reservationOrderList/list';
    let goPathUrl =  index;
    this.context.router.push(goPathUrl);
  },

  render () {
    let path = this.props.location.pathname;
    let detailData = this.state.detailData;
    console.log(detailData);
    let lastPath = path.split('/')[path.split('/').length - 1];
    console.log(lastPath)
    let routerItem = {
      'list': '预约单列表',
      'reservationOrderList': '预约单列表',
      // 'add': '新增预订单',
      // 'cancle': '取消预订单',
      // 'modify': '修改预订单',
      // 'details': '预订单详情',

    };

    let txtName = ( lastPath == 'list' || lastPath == 'reservationOrderList') ? '' : '返回';

    return (
      <div>
        <div className="nav-bar">
          <Breadcrumb separator="-" >
            <Breadcrumb.Item>{this.state.item}</Breadcrumb.Item>
            <Breadcrumb.Item>{routerItem[lastPath]}</Breadcrumb.Item>
          </Breadcrumb>
        </div>
        <div className="content-wrapper ">
          {this.props.children}
        </div>
      </div>
    );
  }
});

export default Index